<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>bootstrap Demo</title>
    <link rel="stylesheet" href="./styles/bootstrap.min.css">
    <link rel="stylesheet" href="./styles/font-awesome.min.css">
    <link rel="stylesheet" href="./styles/aboutServer.css">
    <link rel="stylesheet" href="./styles/bootstrap-datetimepicker.min.css">
</head>

<body>
    <!-- 导航go -->
    <div class="all_nav navbar navbar-default navbar-fixed-top" id="navbar" role="navigation">
        <div class="container">
            <div class="col-md-2">
                <a href="javascript: void(0);">HeiKiz</a>
            </div>
            <div class="col-md-8">
                <ul class="nav_show nav navbar-nav">
                    <li>
                        <a href="./index.html">首页</a>
                    </li>
                    <li>
                        <a class="nav_choose" href="./servar_aboutServer.html">服务商管理</a>
                    </li>
                    <li>
                        <a href="./institution_aboutInstitution.html">机构管理</a>
                    </li>
                    <li>
                        <a href="./teacher_teacherIndex.html">师训管理</a>
                    </li>
                    <li>
                        <a href="./order_orderManagement.html">订单管理</a>
                    </li>
                    <li>
                        <a href="./data_statisticalData.html">数据统计</a>
                    </li>
                </ul>
            </div>
            <div class="use_info col-md-2">
                <a href="javascript: void(0);" id="dropdownMenu1" data-toggle="dropdown">
                    <img class="user_img" src="./images/timg.jpg">
                    <p class="user_name">开心麻花</p>
                    <span class="caret"></span>
                </a>
                <ul id="dropdown_menu" class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
                    <li role="presentation">
                        <a id="id1" role="menuitem" tabindex="-1" href="javascript: void(0);">保存密码</a>
                    </li>
                    <li role="presentation">
                        <a id="id2" role="menuitem" tabindex="-1" href="javascript: void(0);">退出账号</a>
                    </li>
                </ul>
            </div>
        </div>
    </div>
    <!-- 导航 end -->

    <!-- 数据概览 -->
    <div class="list_main container">
        <div class="clearfix">
            <div class="all_choose pull-left">
                <form class="form-inline">
                    <div data-toggle="distpicker">
                        <div class="position form-group pull-left">
                            <label class="sr-only" for="choose_province">Province</label>
                            <select class="form-control" id="choose_province"></select>
                        </div>
                        <div class="position form-group pull-left">
                            <label class="sr-only" for="choose_city">City</label>
                            <select class="form-control" id="choose_city"></select>
                        </div>
                        <!--<div class="position form-group pull-left">
                            <label class="sr-only" for="choose_district">District</label>
                            <select class="form-control" id="choose_district"></select>
                        </div>-->
                    </div>
                </form>



            </div>
            <div class="add_server pull-right" data-toggle="modal" data-target="#myAdd">添加服务商</div>
        </div>
    </div> 

    <!-- 服务商 -->
    <div class="no_shipped_wrap container">
        <div class="row">
            <!-- table 部分 -->
            <div class="table_body" id="table_body">
                <table class="table table-hover">
                    <thead>
                        <tr>
                            <th class="col-md-2">名称</th>
                            <th class="col-md-2">省市区</th>
                            <th class="col-md-2">联系电话</th>
                            <th class="col-md-2">有效期至</th>
                            <th class="col-md-3">状态</th>
                            <th class="col-md-1">操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>HeiPis</td>
                            <td>北京</td>
                            <td>13872635425</td>
                            <td>2018-10-09</td>
                            <td>考核期</td>
                            <td class="table_operation">
                                <a class="goDetail" href="javascript: void(0);">查看详情</a>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
    <!-- 添加内容 modal-->
    <div class="add_modal modal fade" id="myAdd" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <h4 class="modal-title" id="myModalLabel">添加服务商</h4>
                </div>
                <div class="modal-body">
                    <div class="server_list server_number clearfix">
                        <p class="server_title pull-left col-md-2">编号:</p>
                        <div class="form-group col-md-10">
                            <input type="text" class="form-control" id="number_val" placeholder="输入合同编号">
                        </div>

                    </div>
                    <div class="server_list server_name clearfix">
                        <p class="server_title pull-left col-md-2">名字:</p>
                        <div class="form-group col-md-10">
                            <input type="text" class="form-control" id="name_val" placeholder="输入服务商名称">
                        </div>

                    </div>
                    <div class="server_list server_city clearfix">
                        <p class="server_title pull-left col-md-2">城市:</p>
                        <form class="form-inline col-md-10">
                            <div data-toggle="distpicker">
                                <div class="server_position position form-group pull-left">
                                    <label class="sr-only" for="add_province">Province</label>
                                    <select class="form_seclect form-control" id="add_province"></select>
                                </div>
                                <div class="server_position position form-group pull-left">
                                    <label class="sr-only" for="add_city">City</label>
                                    <select class="form_seclect form-control" id="add_city"></select>
                                </div>
                                <div class="server_position position form-group pull-left">
                                    <label class="sr-only" for="add_district">District</label>
                                    <select class="form_seclect form-control" id="add_district"></select>
                                </div>
                            </div>
                        </form>
                    </div>
                    <div class="server_list server_contacts clearfix">
                        <p class="server_title pull-left col-md-2">联系人:</p>
                        <div class="form-group col-md-10">
                            <input type="text" class="form-control" id="contacts_val" placeholder="输入联系人姓名">
                        </div>
                    </div>
                    <div class="server_list server_linkNumber clearfix">
                        <p class="server_title pull-left col-md-2">联系电话:</p>
                        <div class="form-group col-md-10">
                            <input type="text" class="form-control" id="linkNumber_val" placeholder="输入联系人电话">
                        </div>
                    </div>
                    <div class="server_list server_address clearfix">
                        <p class="server_title pull-left col-md-2">联系地址:</p>
                        <div class="form-group col-md-10">
                            <input type="text" class="form-control" id="address_val" placeholder="输入联系人地址">
                        </div>
                    </div>
                    <div class="server_list server_timeValidity clearfix">
                        <p class="server_title pull-left col-md-2">有效期:</p>
                        <div class="server_timeValidity_list form-group col-md-10">
                            <div class="col-md-2 row">
                                <input type="text" maxlength="2" class="form-control" id="year_val">
                            </div>
                            <p class="col-md-1 row">年</p>
                            <!-- 能用的到的时间 -->
                            <div class="time_group input-append date form-group pull-left" id="validityTime" data-date="2012-12-24" data-date-format="dd-mm-yyyy">
                                <input size="16" type="text" class="form-control" value="2012-12-24" readonly>
                                <span class="time_icon add-on">
                                    <i class="icon-sort"></i>
                                </span>
                            </div>
                        </div>
                    </div>
                    <div class="server_list server_account clearfix">
                        <p class="server_title pull-left col-md-2">登录账号:</p>
                        <div class="form-group col-md-10">
                            <input type="text" class="form-control" id="account_val" placeholder="输入登录账号">
                        </div>
                    </div>
                    <div class="server_list server_password clearfix">
                        <p class="server_title pull-left col-md-2">登录密码:</p>
                        <div class="form-group col-md-10">
                            <input type="text" class="form-control" id="password_val" placeholder="输入登录密码">
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" id="btn_cancel" class="btn_cancel btn btn-default pull-left" data-dismiss="modal">取消</button>
                    <button type="button" id="btn_save" class="btn_save btn btn-primary pull-right" data-dismiss="modal">保存</button>
                </div>
            </div>
        </div>
    </div>


    <script src="./javascripts/jquery-1.9.1.min.js"></script>
    <script src="./javascripts/bootstrap.min.js"></script>
    <script src="./javascripts/distpicker.data.min.js"></script>
    <script src="./javascripts/distpicker.min.js"></script>
    <script src="./javascripts/bootstrap-datetimepicker.min.js"></script>
    <script src="./javascripts/bootstrap-datetimepicker.zh-CN.js"></script>
    <script type="text/javascript">
        $(function () {
            // 导航选项 点击
            $(".nav_show>li a").click(function () {
                console.log($(this).index());
                $(this).addClass('nav_choose')
                    .parent("li").siblings().find("a")
                    .removeClass('nav_choose');
            })
            // try
            $("#id1").click(function () {
                console.log("id1---")
            })
            $("#id2").click(function () {
                console.log("id1--111-")
            })
            // title 定义省份
            var $chooseProvince  = $("#choose_province");
            var $chooseCity  = $("#choose_city");
            // 定义要穿入的省市
            var $provincing = null;
            var $citing = null;
            $provincing = $chooseProvince.val();
            $citing = $chooseCity.val();
            console.log("省份--", $provincing,"市区", $citing );

            // 省份改变
            $chooseProvince.change(function(){
                $provincing = $chooseProvince.val();
                $citing = $chooseCity.val();
                console.log("省份--", $provincing,"市区", $citing );
            })

            // 市区改变
            $chooseCity.change(function(){
                $provincing = $chooseProvince.val();
                $citing = $chooseCity.val();
                console.log("省份--", $provincing,"市区", $citing );
            })

            // 添加服务商 定义省份


            // validityTime 时间
            $("#validityTime").datetimepicker({
                format: "yyyy-mm-dd",
                language: "zh-CN",
                weekStart: 1,
                minView: "month",//设置只显示到月份
                autoclose:true,//选中关闭
            });

            // 保存 添加服务商
            $("#btn_save").click(function(){
                console.log("save...")
            })
            // 取消 添加服务商
            $("#btn_cancel").click(function(){
                console.log("cancel...")
            })
            // 隐藏 添加服务商模态框
            $('#myAdd').on('hide.bs.modal', function () {
                console.log("hide")
            })

            // 查看详情
            $("#table_body").on("click", ".goDetail", function(){
                window.location.href= "./server_serverDetail.html"
            })

        })
    </script>
</body>

</html>